package cn.com.nes.mybatis.agent.ope.mapper;

import cn.com.nes.mybatis.agent.ope.entity.SaleOrderInfo;
import cn.com.nes.site.entity.bo.crm.sale.SaleOrderPageBO;
import cn.com.nes.site.entity.bo.crm.sale.UnDispatchedSaleOrderPageBO;
import cn.com.nes.site.service.crm.order.bo.QuerySaleOrderDetailBO;
import cn.com.nes.site.service.crm.order.dto.SaleOrderInfoDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
/**
 * 销售订单映射
 *
 * @Author: ShenWei
 * @Date: 2024/03/15/14:00
 */
public interface SaleOrderInfoMapper extends BaseMapper<SaleOrderInfo> {

    String getCustomerId(@Param("orderId") Long orderId);

    void disableSaleOrderForOpportunity(@Param("businessId") String businessId);

    Boolean hasOrderStatusOnSale(@Param("businessId") String businessId);

    List<SaleOrderInfoDTO> getOrderPage(Page<SaleOrderInfoDTO> page, @Param("bo") UnDispatchedSaleOrderPageBO bo);

    SaleOrderInfo getSaleOrder(@Param("businessId") String businessId);

    List<SaleOrderInfo> getOrdersPage(Page<SaleOrderInfo> page, @Param("bo") SaleOrderPageBO bo);

    List<SaleOrderInfoDTO> getSaleOrderInfoListByCustomerId(@Param("customerIdList") List<String> customerIdList);

    void deleteByCustomerIds(@Param("deletedCustomerIds") List<String> deletedCustomerIds, @Param("operateUserId") Long operateUserId, @Param("operateDate") Date operateDate);

    Integer getSystemNumberByOpportunityList(@Param("opportunities") List<String> opportunities);

    SaleOrderInfoDTO getSaleOrderDetail(@Param("queryBO") QuerySaleOrderDetailBO queryBO);
}
